﻿#include <iostream>
#include "Couleurs.h"
#include <iomanip>
#include "Rectangle.h"
#include "Circle.h"
#include "Vector.h"
#include "LineSegment.h"

using namespace std;


int main() {

	HANDLE	handleOut = GetStdHandle(STD_OUTPUT_HANDLE);

	/*{
		forme::Rectangle *rect;
		rect = new forme::Rectangle(1, 1, 3, 3);

		cout << rect->GetWidth();
	}*/

#pragma region Vector2D
	cout << endl << endl;
	TextColor("\t\t\t+++++ Vector2D tests +++++\n", TEXT_YELLOW);

	cout << "Test de simple addition vecteur a vecteur" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS,"     avec (9, -5) + (-9, 5) = (0, 0) : ", GRIS, handleOut);
			Vector2D u = {9, -5};
			Vector2D v = {-9, 5};
			Vector2D add = Add(&u, &v);
			Vector2D r = {0, 0};
			if (Equals(&add, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15) + (-80, 30.5) = (-60, 45.5 ): ", GRIS, handleOut);
			Vector2D u = {20, 15};
			Vector2D v = {-80, 30.5};
			Vector2D add = Add(&u, &v);
			Vector2D r = {-60, 45.5};
			if (Equals(&add, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Test de simple Soustraction vecteur a vecteur" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (100, -99) - (100, -99) = 0 : ", GRIS, handleOut);
			Vector2D u = {100, -99};
			Vector2D sub = Substract(&u, &u);
			Vector2D r = {0, 0};
			if (Equals(&sub, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15) - (-80, 30.5) = (100, -15.5 ): ", GRIS, handleOut);
			Vector2D u = {20, 15};
			Vector2D v = {-80, 30.5};
			Vector2D sub = Substract(&u, &v);
			Vector2D r = {100, -15.5};
			if (Equals(&sub, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Simple Scale" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15) * 4 = (80, 60): ", GRIS, handleOut);
			Vector2D u = {20, 15};
			float scaleFactor = 4.0f;
			Vector2D scale = Scale(&u, scaleFactor);
			Vector2D r = {80, 60 };
			if (Equals(&scale, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15) * 0 = (0, 0): ", GRIS, handleOut);
			Vector2D u = {20, 15};
			float scaleFactor = 0.0f;
			Vector2D scale = Scale(&u, scaleFactor);
			Vector2D r = {0, 0};
			if (Equals(&scale, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15) * -2 = (-40, -30): ", GRIS, handleOut);
			Vector2D u = {20, 15};
			float scaleFactor = -2.0f;
			Vector2D scale = Scale(&u, scaleFactor);
			Vector2D r = {-40, -30};
			if (Equals(&scale, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Move by" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15) by (-80, 30.5) = (-60, 45.5 ): ", GRIS, handleOut);
			Vector2D u = {20, 15};
			Vector2D v = {-80, 30.5};
			MoveBy(&v, &u);
			Vector2D r = {-60, 45.5};
			if (Equals(&u, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Get Polar Angle" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 45 degree ", GRIS, handleOut);
			Vector2D vect = {5,5};
			float deg = GetPolarAngleDeg(&vect);
			float degCompare = 45.0f;
			if (deg == degCompare) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Get Angle Between Vector" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 90 degree ", GRIS, handleOut);
			Vector2D vect1 = {0,5};
			Vector2D vect2 = {3,0};
			float deg = AngleBetweenDeg(&vect1, &vect2);
			float degCompare = 90.0f;
			if ( deg == degCompare) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 270 degree ", GRIS, handleOut);
			Vector2D vect1 = {0,-5};
			Vector2D vect2 = {3,0};
			float deg = AngleBetweenDeg(&vect1, &vect2);
			float degCompare = 270.0f;
			if ( deg == degCompare) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Longuer d'un vecteur" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (0, 5) = 5", GRIS, handleOut);
			Vector2D vect1 = {0,5};
			float length = Length(&vect1);
			float lengthCompare = 5.0f;
			if ( length == lengthCompare) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Longuer d'un vecteur au carre" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (0, 5) = 25" , GRIS, handleOut);
			Vector2D vect1 = {0,5};
			float length = LengthSq(&vect1);
			float lengthCompare = 25.0f;
			if ( length == lengthCompare) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Normalisation d'un vecteur" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (0, 5) = true et length = 1", GRIS, handleOut);
			Vector2D vect1 = {0,5};
			bool norm = Normalize(&vect1);
			if (norm && (Length(&vect1) == 1.0f)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (0, 0) = false", GRIS, handleOut);
			Vector2D vect1 = {0,0};
			bool norm = Normalize(&vect1);
			if (!norm) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}
	cout << "Scale by" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15) * 4 = (80, 60 )", GRIS, handleOut);
			Vector2D u = {20, 15};
			float scaleFactor = 4.0f;
			ScaleBy(&u, scaleFactor);		
			Vector2D r = {80, 60 };
			if (Equals(&u, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Get Vector By Angle" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec angle = 90 degree", GRIS, handleOut);
			float angle = 90.0f;
			Vector2D vect = GetVectorByAngleDeg(angle);
			Vector2D r = {0, 1};
			if (Equals(&vect, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Equals" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (0,1) et (0,1) = true", GRIS, handleOut);
			Vector2D v1 = {0,1};
			Vector2D v2 = {0,1};
			if (Equals(&v1, &v2)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}
#pragma endregion Vector2D

#pragma region Vector3D
	cout << endl << endl;
	TextColor("\t\t\t+++++ Vector3D tests +++++\n", TEXT_YELLOW);

	cout << "Simple addition" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (9, -5, -2) + (-(-9, 5, 2)) = 0 : ", GRIS, handleOut);
			Vector3D u = {9, -5, -2};
			Vector3D v = {-9, 5, 2};
			Vector3D add = Add(&u, &v);
			Vector3D r = {0, 0, 0};
			if (Equals(&add, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15, 4) + (-80, 30.5, 6) = (-60, 45.5, 10): ", GRIS, handleOut);
			Vector3D u = {20, 15, 4};
			Vector3D v = {-80, 30.5, 6};
			Vector3D add = Add(&u, &v);
			Vector3D r = {-60, 45.5, 10};
			if (Equals(&add, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Simple substraction" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (100, -99, 150) - (100, -99, 150) = 0 : ", GRIS, handleOut);
			Vector3D u = {100, -99, 150};
			Vector3D sub = Substract(&u, &u);
			Vector3D r = {0, 0, 0};
			if (Equals(&sub, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15, 4) - (-80, 30.5, 6) = (100, -15.5, -2): ", GRIS, handleOut);
			Vector3D u = {20, 15, 4};
			Vector3D v = {-80, 30.5, 6};
			Vector3D sub = Substract(&u, &v);
			Vector3D r = {100, -15.5, -2};
			if (Equals(&sub, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}
	
	cout << "Simple Scale" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15, 10) * 4 = (80, 60, 40): ", GRIS, handleOut);
			Vector3D u = {20, 15, 10};
			float scaleFactor = 4.0f;
			Vector3D scale = Scale(&u, scaleFactor);
			Vector3D r = {80, 60, 40};
			if (Equals(&scale, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15, 10) * 0 = (0, 0, 0): ", GRIS, handleOut);
			Vector3D u = {20, 15, 10};
			float scaleFactor = 0.0f;
			Vector3D scale = Scale(&u, scaleFactor);
			Vector3D r = {0, 0, 0};
			if (Equals(&scale, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15, 10) * -2 = (-40, -30, -20): ", GRIS, handleOut);
			Vector3D u = {20, 15, 10};
			float scaleFactor = -2.0f;
			Vector3D scale = Scale(&u, scaleFactor);
			Vector3D r = {-40, -30, -20};
			if (Equals(&scale, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Move by" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15, 4) by (-80, 30.5, 6) = (-60, 45.5, 10): ", GRIS, handleOut);
			Vector3D u = {20, 15, 4};
			Vector3D v = {-80, 30.5, 6};
			MoveBy(&v, &u);
			Vector3D r = {-60, 45.5, 10};
			if (Equals(&u, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Dot product" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (1, 3, -5) . (4, -2, -1) = 3: ", GRIS, handleOut);
			Vector3D u = {1, 3, -5};
			Vector3D v = {4, -2, -1};
			float compare = 3.0f;
			float product = Dot(&u, &v);
			if (product = compare) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Cross product Right Hand" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec {1,2,3} * {3,2,1} = {-4, 8, -4}: ", GRIS, handleOut);
			Vector3D i = {1, 2, 3};
			Vector3D j = {3, 2, 1};
			Vector3D xRh = CrossRH(&i, &j);
			Vector3D k = {-4, 8, -4};
			if (Equals(&xRh, &k)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec i * j = k: ", GRIS, handleOut);
			Vector3D i = {1, 0, 0};
			Vector3D j = {0, 1, 0};
			Vector3D xRh = CrossRH(&i, &j);
			Vector3D k = {0, 0, 1};
			if (Equals(&xRh, &k)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Cross product Left Hand" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec i * j = -k: ", GRIS, handleOut);
			Vector3D i = {1, 0, 0};
			Vector3D j = {0, 1, 0};
			Vector3D xLh = CrossLH(&i, &j);
			Vector3D k = {0, 0, -1};
			if (Equals(&xLh, &k)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Longuer d'un vecteur" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (0, 5, 5) = 7.0710678", GRIS, handleOut);
			Vector3D vect1 = {0, 5, 5};
			float length = Length(&vect1);
			float lengthCompare = 7.0710678f;
			if ( length == lengthCompare) {
				TextColor("OK\n", GREEN);
			} else {
				cout << "longeur = " << length;
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Longuer d'un vecteur au carre" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (0, 5, 5) = 50", GRIS, handleOut);
			Vector3D vect1 = {0, 5, 5};
			float length = LengthSq(&vect1);
			float lengthCompare = 50.0f;
			if ( length == lengthCompare) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Normalisation d'un vecteur" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (0, 5, 5) = true et length = 1", GRIS, handleOut);
			Vector3D vect1 = {0, 5, 5};
			bool norm = Normalize(&vect1);
			if (norm && (abs(Length(&vect1) - 1.0f) < EPSILON)) {
				TextColor("OK\n", GREEN);
			} else {
				cout << Length(&vect1);
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (0, 0, 0) = false", GRIS, handleOut);
			Vector3D vect1 = {0, 0, 0};
			bool norm = Normalize(&vect1);
			if (!norm) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Scale by" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (20, 15, 10) * 4 = (80, 60, 40): ", GRIS, handleOut);
			Vector3D u = {20, 15, 10};
			float scaleFactor = 4.0f;
			ScaleBy(&u, scaleFactor);		
			Vector3D r = {80, 60, 40};
			if (Equals(&u, &r)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

	cout << "Equals" << endl;
	{
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (0, 1, 4) = (0, 1, 4)", GRIS, handleOut);
			Vector3D v1 = {0, 1, 4};
			Vector3D v2 = {0, 1, 4};
			if (Equals(&v1, &v2)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}

#pragma endregion Vector3D

#pragma region Rectangle
	cout << endl << endl;
	TextColor("\t\t\t+++++ Rectangle tests +++++\n", TEXT_YELLOW);
	{
		
		cout << "Constructeur(5.0f, 4.0f, 10.0f, 7.0f): " << endl ;
		cout << "& GetX(), GetY()" << endl;
		cout << "& GetWidth(), GetHeight()" << endl;

		forme::Rectangle rect1(5.0f, 4.0f, 10.0f, 7.0f);

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     rect1.GetX() == 5.0f: ", GRIS, handleOut);

		if (rect1.GetX() == 5.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     rect1.GetY() == 4.0f: ", GRIS, handleOut);

		if (rect1.GetY() == 4.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     rect1.GetWidth() == 10.0f: ", GRIS, handleOut);

		if (rect1.GetWidth() == 10.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     rect1.GetHeight() == 7.0f: ", GRIS, handleOut);

		if (rect1.GetHeight() == 7.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}

	}
	{
		cout << "Constructeur(Vector, Vector): " << endl ;
		cout << "& GetX(), GetY()" << endl;
		cout << "& GetWidth(), GetHeight()" << endl;

		Vector2D vect1 = {5, 4};
		Vector2D vect2 = {10.0f, 7.0f};
		forme::Rectangle rect1(&vect1, &vect2);
		
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     rect1.GetX() == 5.0f: ", GRIS, handleOut);

		if (rect1.GetX() == 5.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     rect1.GetY() == 4.0f: ", GRIS, handleOut);

		if (rect1.GetY() == 4.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     rect1.GetWidth() == 10.0f: ", GRIS, handleOut);

		if (rect1.GetWidth() == 5.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     rect1.GetHeight() == 7.0f: ", GRIS, handleOut);

		if (rect1.GetHeight() == 3.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

	}
	{
		cout << "Test de Contains, rect1(5.0f, 4.0f, 10.0f, 7.0f)" << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 6.0f, 5.0f: ", GRIS, handleOut);

		forme::Rectangle rect(5.0f, 4.0f, 10.0f, 7.0f);
		Vector2D vect1 = {6.0f, 5.0f};

		if (rect.Contains(&vect1))
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 6.0f, 5.0f: ", GRIS, handleOut);
		Vector2D vect2 = {6.0f, 5.0f};

		if (rect.Contains(&vect2))
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "SetPosition(Vector2D) : (5, 4, 10, 7) + Vecteur2D(5, 6) : ", GRIS, handleOut);
		Vector2D u = {5, 6};
		forme::Rectangle rect(5.0f, 4.0f, 10.0f, 7.0f);
		rect.SetPosition(&u);
		if (rect.GetX() == 5 && rect.GetY() == 6) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "SetPosition(Float, float) : (5, 4, 10, 7) + (x, y)(5, 6) : ", GRIS, handleOut);
		forme::Rectangle rect(5.0f, 4.0f, 10.0f, 7.0f);
		rect.SetPosition(5, 6);
		if (rect.GetX() == 5 && rect.GetY() == 6) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "MoveBy(Vector2D vect) : (5, 4, 10, 7) + Vecteur2D(5, 6) : ", GRIS, handleOut);
		forme::Rectangle rect(5.0f, 4.0f, 10.0f, 7.0f);
		Vector2D u = {5, 6};
		rect.MoveBy(&u);
		if (rect.GetX() == 10 && rect.GetY() == 10) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "MoveBy(float x, float y) : (5, 4, 10, 7) + (x, y)(5, 6)) : ", GRIS, handleOut);
		forme::Rectangle rect(5.0f, 4.0f, 10.0f, 7.0f);
		rect.MoveBy(5, 6);
		if (rect.GetX() == 10 && rect.GetY() == 10) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}

	{
		cout << "CollidesWith(Rectangle rect) const\n";
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (5, 4, 10, 7), (6, 5, 10, 7)  : (oui)", GRIS, handleOut);
		forme::Rectangle rect(5.0f, 4.0f, 10.0f, 7.0f);
		forme::Rectangle rect2(6.0f, 5.0f, 10.0f, 7.0f);
		
		if (rect.CollidesWith(&rect2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (6, 3, 12, 6), (4, 2, 8, 6)  : (oui)", GRIS, handleOut);
		forme::Rectangle rect(6.0f, 3.0f, 12.0f, 6.0f);
		forme::Rectangle rect2(4.0f, 2.0f, 8.0f, 4.0f);
		
		if (rect.CollidesWith(&rect2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (6, 3, 12, 6), (4, 1, 8, 2)  : (oui)", GRIS, handleOut);
		forme::Rectangle rect(6.0f, 3.0f, 12.0f, 6.0f);
		forme::Rectangle rect2(4.0f, 1.0f, 8.0f, 2.0f);
		
		if (rect.CollidesWith(&rect2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (0, 0, 5, 3), (5, 3, 2, 3)  : (oui)", GRIS, handleOut);
		forme::Rectangle rect(0.0f, 0.0f, 5.0f, 3.0f);
		forme::Rectangle rect2(5, 3, 2, 3);
		
		if (rect.CollidesWith(&rect2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (-1, -4, 5, 3), (-3, -1, 5, 3)  : (oui)", GRIS, handleOut);
		forme::Rectangle rect(-1, -4, 5, 3);
		forme::Rectangle rect2(-3, -1, 5, 3);
		
		if (rect.CollidesWith(&rect2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (-1, -4, 5, 3), (-3, 0, 5, 3)  : (non)", GRIS, handleOut);
		forme::Rectangle rect(-1, -4, 5, 3);
		forme::Rectangle rect2(-3, 0, 5, 3);
		
		if (!rect.CollidesWith(&rect2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
#pragma endregion Rectangle

#pragma region Circle
	cout << endl << endl;
	TextColor("\t\t\t+++++ Circle tests +++++\n", TEXT_YELLOW);
	{
		
		cout << "Constructeur(5.0f, 4.0f, 10.0f): " << endl ;
		cout << "& GetX(), GetY()" << endl;
		cout << "& GetRadius(), GetRadiusSq()" << endl;

		forme::Circle circ1(5.0f, 4.0f, 10.0f);

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     circ1.GetX() == 5.0f: ", GRIS, handleOut);

		if (circ1.GetX() == 5.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     circ1.GetY() == 4.0f: ", GRIS, handleOut);

		if (circ1.GetY() == 4.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     circ1.GetRadius() == 10.0f: ", GRIS, handleOut);

		if (circ1.GetRadius() == 10.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     circ1.GetRadiusSq() == 100.0f: ", GRIS, handleOut);
		
		if (circ1.GetRadiusSq() == 100.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}

	}
	{
		cout << "Constructeur(Vector, 10.0f): " << endl ;
		cout << "& GetX(), GetY()" << endl;
		cout << "& GetRadius(), GetRadiusSq()" << endl;
		
		Vector2D vect1 = {5.0f, 4.0f};
		forme::Circle circ1(&vect1, 10.0f);

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     circ1.GetX() == 5.0f: ", GRIS, handleOut);

		if (circ1.GetX() == 5.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     circ1.GetY() == 4.0f: ", GRIS, handleOut);

		if (circ1.GetY() == 4.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     circ1.GetRadius() == 10.0f: ", GRIS, handleOut);

		if (circ1.GetRadius() == 10.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     circ1.GetRadiusSq() == 100.0f: ", GRIS, handleOut);
		
		if (circ1.GetRadiusSq() == 100.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
	}
	{
		cout << "Test de Contains, rect1(5.0f, 4.0f, 10.0f, 7.0f)" << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 6.0f, 5.0f: ", GRIS, handleOut);

		forme::Circle circ1(5.0f, 4.0f, 10.0f);
		Vector2D vect1 = {6.0f, 5.0f};

		if (circ1.Contains(&vect1))
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 6.0f, 5.0f: ", GRIS, handleOut);
		Vector2D vect2 = {6.0f, 5.0f};

		if (circ1.Contains(&vect2))
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "SetPosition(Vector2D) : (5, 4, 10) + Vecteur2D(6, 5) : ", GRIS, handleOut);
		
		Vector2D vect1 = {6.0f, 5.0f};
		forme::Circle circ1(5.0f, 4.0f, 10.0f);

		circ1.SetPosition(&vect1);
		if (circ1.GetX() == 6 && circ1.GetY() == 5)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "SetPosition(Float, float) : (5, 4, 10) + (x, y)(5, 6) : ", GRIS, handleOut);
		
		forme::Circle circ1(5.0f, 4.0f, 10.0f);

		circ1.SetPosition(5, 6);

		if (circ1.GetX() == 5 && circ1.GetY() == 6)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "MoveBy(Vector2D vect) : (5, 4, 10) + Vecteur2D(5, 6) : ", GRIS, handleOut);
		
		forme::Circle circ1(5.0f, 4.0f, 10.0f);
		
		Vector2D u = {5, 6};

		circ1.MoveBy(&u);

		if (circ1.GetX() == 10 && circ1.GetY() == 10) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "MoveBy(float x, float y) : (5, 4, 10) + (x, y)(5, 6)) : ", GRIS, handleOut);
		forme::Circle circ1(5, 4, 10);
		circ1.MoveBy(5, 6);
		if (circ1.GetX() == 10 && circ1.GetY() == 10) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	
	{
		cout << "CollidesWith(Circle rect) const\n";
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (5, 4, 10), (6, 5, 10)  : (oui)", GRIS, handleOut);
		forme::Circle circ1(5.0f, 4.0f, 10.0f);
		forme::Circle circ2(6.0f, 5.0f, 10.0f);
		
		if (circ1.CollidesWith(&circ2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "CollidesWith(Circle rect) const\n";
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (5, 4, 10), (5, 4, 10)  : (oui)", GRIS, handleOut);
		forme::Circle circ1(5.0f, 4.0f, 10.0f);
		forme::Circle circ2(5.0f, 4.0f, 10.0f);
		
		if (circ1.CollidesWith(&circ2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "CollidesWith(Circle rect) const\n";
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (5, 4, 10), (5, 4, 1)  : (oui)", GRIS, handleOut);
		forme::Circle circ1(5.0f, 4.0f, 10.0f);
		forme::Circle circ2(5.0f, 4.0f, 1.0f);
		
		if (circ1.CollidesWith(&circ2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "CollidesWith(Circle rect) const\n";
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (5, 4, 10), (5, 4, 1)  : (oui)", GRIS, handleOut);
		forme::Circle circ1(5.0f, 4.0f, 10.0f);
		forme::Circle circ2(16.0f, 4.0f, 1.0f);
		
		if (circ1.CollidesWith(&circ2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "CollidesWith(Circle rect) const\n";

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (5, 4, 10), (16.1f, 4, 1)  : (non)", GRIS, handleOut);

		forme::Circle circ1(5.0f, 4.0f, 10.0f);
		forme::Circle circ2(16.1f, 4.0f, 1);
		
		if (!circ1.CollidesWith(&circ2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
#pragma endregion Circle

#pragma region LineSegment
	cout << endl << endl;
	TextColor("\t\t\t+++++ LineSegment tests +++++\n", TEXT_YELLOW);
	{
		cout << "Constructeur(5.0f, 4.0f, 10.0f, 12.0f): " << endl ;
		cout << "& GetFromPoint(), GetToPoint()" << endl;

		LineSegment lineSegm1(5.0f, 4.0f, 10.0f, 12.0f);

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     lineSegm1.GetFromPoint().x == 5.0f: ", GRIS, handleOut);

		if (lineSegm1.GetFromPoint().x == 5.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     lineSegm1.GetFromPoint().y == 4.0f: ", GRIS, handleOut);

		if (lineSegm1.GetFromPoint().y == 4.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		
		
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     lineSegm1.GetToPoint().x == 10.0f: ", GRIS, handleOut);

		if (lineSegm1.GetToPoint().x == 10.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		
		
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     lineSegm1.GetToPoint().y == 12.0f: ", GRIS, handleOut);

		if (lineSegm1.GetToPoint().y == 12.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
	}
	{
		cout << "Constructeur(Vector Vector): " << endl ;
		cout << "& GetFromPoint(), GetToPoint()" << endl;
		
		Vector2D vect1 = {5.0f, 4.0f};
		Vector2D vect2 = {10.0f, 12.0f};
		
		LineSegment lineSegm1(&vect1, &vect2);

		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     lineSegm1.GetFromPoint().x == 5.0f: ", GRIS, handleOut);

		if (lineSegm1.GetFromPoint().x == 5.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     lineSegm1.GetFromPoint().y == 4.0f: ", GRIS, handleOut);

		if (lineSegm1.GetFromPoint().y == 4.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		
		
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     lineSegm1.GetToPoint().x == 10.0f: ", GRIS, handleOut);

		if (lineSegm1.GetToPoint().x == 10.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
		
		
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     lineSegm1.GetToPoint().y == 12.0f: ", GRIS, handleOut);

		if (lineSegm1.GetToPoint().y == 12.0f)
		{
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED\n", RED);
		}
	}
	{	
		cout << "GetNormal(): " << endl ;
		{
			Vector2D vect1 = {0.0f, 0.0f};
			Vector2D vect2 = {0.0f, 10.0f};
		
			LineSegment lineSegm1(&vect1, &vect2);

			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     GetNormal() == -1: ", GRIS, handleOut);

			if ((lineSegm1.GetNormal().x == 1 || lineSegm1.GetNormal().x == -1) && lineSegm1.GetNormal().y == 0)
			{
				TextColor("OK\n", GREEN);
			} else {
				cout << lineSegm1.GetNormal().x;
				TextColor("FAILED\n", RED);
			}
		}
		{
			Vector2D vect1 = {0.0f, 0.0f};
			Vector2D vect2 = {10.0f, 10.0f};
			
			Vector2D normal = {-10.0f, 10.0f};
			Normalize(&normal);

			LineSegment lineSegm1(&vect1, &vect2);

			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     GetNormal() == {-sqrt(1), sqrt(1)}: ", GRIS, handleOut);

			if (Equals(&lineSegm1.GetNormal(), &normal))
			{
				TextColor("OK\n", GREEN);
			} else {
				cout << normal.x << endl;
				cout << normal.y << endl;
				cout << lineSegm1.GetNormal().x << endl;
				cout << lineSegm1.GetNormal().y << endl;
				TextColor("FAILED\n", RED);
			}
		}
	}
	cout << "IntersectsWith(LineSegment seg) const\n";
	{
		cout << "     avec 2 droites a 45 degres et 135 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          perpendiculaires qui se croisent au millieu  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(0, 0, 10, 10);
		LineSegment lineSegm2(10, 0, 0, 10);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 135 degres et 45 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          perpendiculaires qui se croisent au millieu  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(0, 0, 10, 10);
		LineSegment lineSegm2(10, 0, 0, 10);
		
		if (lineSegm2.IntersectsWith(&lineSegm1)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 45 degres et 135 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          perpendiculaires qui ne se croisent pas  : (non)", GRIS, handleOut);
		LineSegment lineSegm1(0, 0, 4, 4);
		LineSegment lineSegm2(10, 0, 0, 10);
		
		if (!lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
				TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 135 degres et 45 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          perpendiculaires qui ne se croisent pas  : (non)", GRIS, handleOut);
		LineSegment lineSegm1(0, 0, 10, 10);
		LineSegment lineSegm2(10, 0, 6, 4);
		
		if (!lineSegm2.IntersectsWith(&lineSegm1)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          verticale qui croise horizontale au millieu  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(0, 0, 0, 10);
		LineSegment lineSegm2(-2, 2, 2, 2);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          verticale qui croise horizontale a l'extreme bas  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(0, 0, 0, -10);
		LineSegment lineSegm2(-2, 0, 2, 0);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          verticale qui croise horizontale a l'extreme haut  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(0, 0, 0, 10);
		LineSegment lineSegm2(-2, 0, 2, 0);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          verticale qui croise horizontale a l'extreme gauche  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(-2, 0, -2, 10);
		LineSegment lineSegm2(-2, 2, 2, 2);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          verticale qui croise horizontale a l'extreme droite  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(2, 0, 2, 10);
		LineSegment lineSegm2(-2, 2, 2, 2);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          horizontale qui croise verticale au millieu  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(0, 0, 0, 10);
		LineSegment lineSegm2(-2, 2, 2, 2);
		
		if (lineSegm2.IntersectsWith(&lineSegm1)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          horizontale qui croise verticale a l'extreme bas  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(0, 0, 0, 10);
		LineSegment lineSegm2(-2, 0, 2, 0);
		
		if (lineSegm2.IntersectsWith(&lineSegm1)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          horizontale qui croise verticale a l'extreme gauche  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(-2, 0, -2, 10);
		LineSegment lineSegm2(-2, 2, 2, 2);
		
		if (lineSegm2.IntersectsWith(&lineSegm1)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          horizontale qui croise verticale a l'extreme droite  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(2, 0, 2, 10);
		LineSegment lineSegm2(-2, 2, 2, 2);
		
		if (lineSegm2.IntersectsWith(&lineSegm1)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          horizontale qui croise verticale a l'extreme haut  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(0, 0, 0, 10);
		LineSegment lineSegm2(-2, 10, 2, 10);
		
		if (lineSegm2.IntersectsWith(&lineSegm1)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          verticale plus bas que horizontale  : (non)", GRIS, handleOut);
		LineSegment lineSegm1(0, -10, 0, 1);
		LineSegment lineSegm2(-2, 2, 2, 2);
		
		if (!lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          verticale plus haut que horizontale  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(0, 0, 0, 10);
		LineSegment lineSegm2(-2, -1, 2, -1);
		
		if (!lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          verticale plus a gauche que horizontale  : (non)", GRIS, handleOut);
		LineSegment lineSegm1(-3, 0, -3, 10);
		LineSegment lineSegm2(-2, 2, 2, 2);
		
		if (!lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 90 degres et 0 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          verticale plus a droite que horizontale  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(3, 0, 3, 10);
		LineSegment lineSegm2(-2, 2, 2, 2);
		
		if (!lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec le point d'origine et une droite de 45 degre : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(-10, -10, 10, 10);
		LineSegment lineSegm2(0, 0, 0, 0);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		cout << "     avec 2 droites a 45 degres et 90 degre," << endl;
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "          verticale croisant oblique par l'extreme bas  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(-10, -10, 10, 10);
		LineSegment lineSegm2(1, 2, 1, 1);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 2 droites paralelles horizontales confondues  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(1, 2, 1, 2);
		LineSegment lineSegm2(1, 2, 1, 2);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 2 droites paralelles horizontales distinctes  : (non)", GRIS, handleOut);
		LineSegment lineSegm1(1, 3, 1, 3);
		LineSegment lineSegm2(1, 2, 1, 2);
		
		if (!lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 2 droites horizontales se touchant a x = 1  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(5, 2, 1, 2);
		LineSegment lineSegm2(-5, 2, 1, 2);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 2 droites obliques se croisant a l'origine  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(-9, 10, 9, -20);
		LineSegment lineSegm2(-50, 0, 50, 0);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 2 droites ayant la meme origine  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(-50, 0, -60, 0);
		LineSegment lineSegm2(-50, 0, 50, 0);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 2 droites confondues  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(100, 44, 100, 22);
		LineSegment lineSegm2(100, 100, 100, -100);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 2 droites ne se croisant pas  : (non)", GRIS, handleOut);
		LineSegment lineSegm1(-10, -10, 10, 10);
		LineSegment lineSegm2(1, 2, 1, 2);
		
		if (!lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 2 droites ne se croisant pas  : (non)", GRIS, handleOut);
		LineSegment lineSegm1(100, 100, 0, 0);
		LineSegment lineSegm2(-50, -1, 50, 0);
		
		if (!lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
	{
		TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec 2 droites confondues  : (oui)", GRIS, handleOut);
		LineSegment lineSegm1(0, 10, 10, 10);
		LineSegment lineSegm2(1, 10, 100, 10);
		
		if (lineSegm1.IntersectsWith(&lineSegm2)) {
			TextColor("OK\n", GREEN);
		} else {
			TextColor("FAILED !\n", RED);
		}
	}
#pragma endregion LineSegment

#pragma region Circle VS Rectangle
	cout << endl << endl;
	TextColor("\t\t\t+++++ Circle VS Rectangle tests +++++\n", TEXT_YELLOW);
	{
		{
			cout << "bool CollidesWith(const Rectangle* rect) const\n";

			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (1, 1, 1), (0, 0, 5, 3)  : (oui)", GRIS, handleOut);

			forme::Circle circ1(1, 1, 1);
			forme::Rectangle rect2(0, 0, 5, 3);
		
			if (circ1.CollidesWith(&rect2)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (8, 8, 1), (0, 0, 5, 3)  : (non)", GRIS, handleOut);

			forme::Circle circ1(8, 8, 1);
			forme::Rectangle rect2(0, 0, 5, 3);
		
			if (!circ1.CollidesWith(&rect2)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (2.5f, 1.5f, 1), (0, 0, 5, 3)  : (oui)", GRIS, handleOut);

			forme::Circle circ1(2.5f, 1.5f, 1);
			forme::Rectangle rect2(0, 0, 5, 3);
		
			if (circ1.CollidesWith(&rect2)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (6, 4, sqrt(2.0f)), (0, 0, 5, 3)  : (non)", GRIS, handleOut);

			forme::Circle circ1(6, 4, sqrt(2.0f));
			forme::Rectangle rect2(0, 0, 5, 3);
		
			if (!circ1.CollidesWith(&rect2)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (1, 1, 1.42f), (0, 0, 5, 3)  : (non)", GRIS, handleOut);

			forme::Circle circ1(6, 4, 1.42f);
			forme::Rectangle rect2(0, 0, 5, 3);
		
			if (!circ1.CollidesWith(&rect2)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
		{
			TextFillColor(71, LEFT, '.', TEXT_DARK_GRIS, "     avec (3, 4, 1), (0, 0, 5, 3)  : (oui)", GRIS, handleOut);

			forme::Circle circ1(3, 4, 1);
			forme::Rectangle rect2(0, 0, 5, 3);
		
			if (circ1.CollidesWith(&rect2)) {
				TextColor("OK\n", GREEN);
			} else {
				TextColor("FAILED !\n", RED);
			}
		}
	}
#pragma endregion Circle VS Rectangle
	system("pause");
	return 0;
}